package com.youu.youu.manager.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.youu.youu.manager.bean.TScenicTicket;
import com.youu.youu.manager.dao.TScenicTicketMapper;
import com.youu.youu.manager.dao.TScenicdetailsMapper;
import com.youu.youu.manager.service.ScenicTicketService;

/**
 * 优惠券实现类
 * @ClassName ScenicTicketServiceImpl
 * @Description TODO(这里用一句话描述这个类的作用)
 * @author Seifon
 * @Date 2017年8月14日 下午9:30:52
 * @version 1.0.0
 */
@Service
public class ScenicTicketServiceImpl implements ScenicTicketService {
    
    @Autowired
    TScenicTicketMapper scenicTicketMapper;
    
    /**
     * 获取优惠券列表
     * @Description (TODO这里用一句话描述这个方法的作用)
     * @return
     */
    public List<TScenicTicket> getList(){
        List<TScenicTicket> list = scenicTicketMapper.select(null);
        return list;
        
    }
    
    /**
     * 添加一条优惠券信息
     * @Description (TODO这里用一句话描述这个方法的作用)
     * @param scenicTicket
     * @return
     */
    public int addScenicTicket(TScenicTicket scenicTicket) {
        int result = scenicTicketMapper.insertSelective(scenicTicket);
        return result;
        
    }
    
    /**
     * 删除一条优惠券信息
     * @Description (TODO这里用一句话描述这个方法的作用)
     * @param id
     * @return
     */
    public int delScenicTicketById(Integer id) {
        int result = scenicTicketMapper.deleteByPrimaryKey(id);
        return result;
    }
    
    /**
     * 修改一条优惠券信息
     * @Description (TODO这里用一句话描述这个方法的作用)
     * @param scenicTicket
     * @return
     */
    public int updateScenicTicket(TScenicTicket scenicTicket) {
        int result = scenicTicketMapper.updateByPrimaryKeySelective(scenicTicket);
        return result;
        
    }

}
